home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Eagles Nest BBS 8
/
Eagles_Nest_Mac_Collection_Disc_8.TOAST
/
Developer Tools⁄Additions
/
InsideBa1994
/
InsideBasic-94
/
IB 94
/
Speech Mgr
/
SPEECH.TLBX
next >
Wrap
Text File
|
1993-05-22
|
10KB
|
345 lines
' FILE: SPEECH.TLBX
'______________________________________________
' Speech Manager Include Part 1 & 2
' ©1993 Ariel Publishing by Raoul Watson
'______________________________________________
INCLUDE FILE 1
COMPILE 1,8
GOTO "skipfns"
'
' FUNCTION CountVoices (numVoices: IntegerPtr): OSErr;
'
' HOW TO CALL THE ROUTINE:
' OSErr = FN CountVoices(@numVoices)
'
LOCAL MODE
LOCAL FN CountVoices(numVoicesPtr&)
` subq.l #2,sp ;clear space for result
` move.l ^numVoicesPtr&,-(sp) ;push VAR pointer on stack
` move.l #$0108000C,D0 ;selector in D0
` dc.w $A800 ;_speechMgr
` move.w (sp)+,D0 ;OSErr into D0
` ext.l D0 ;sign extend word to long
END FN
'
' FUNCTION GetIndVoice (index: Integer;voice: VoiceSpecPtr): OSErr;
'
' HOW TO CALL THE ROUTINE:
' OSErr = FN GetIndVoice(voiceIdx,@VoiceSpec)
'
LOCAL MODE
LOCAL FN GetIndVoice(idx,VoiceSpecPtr&)
` subq.l #2,sp ;clear space for result
` move.w ^idx,-(sp) ;push index on stack
` move.l ^VoiceSpecPtr&,-(sp) ;push VAR pointer on stack
` move.l #$030C000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'
' FUNCTION GetVoiceDescription (voice: VoiceSpecPtr; info:VoiceDescriptionPtr): OSErr;
'
' HOW TO CALL THE ROUTINE:
' OSErr = FN GetVoiceDescription(@VoiceSpec,@VoiceDescription,infolength&)
'
LOCAL MODE
LOCAL FN GetVoiceDescription(VoiceSpecPtr&,VoiceDescriptionPtr&,Parmlength&)
` subq.l #2,sp ;clear space for result
` move.l ^VoiceSpecPtr&,-(sp) ;push pointers on stack
` move.l ^VoiceDescriptionPtr&,-(sp)
` move.l ^Parmlength&,-(sp)
` move.l #$0610000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'
' FUNCTION SpeakString(s: Str255): OSErr;
'
' HOW TO CALL THE ROUTINE:
' OSErr = FN SpeakString(@yourstring$)
'
LOCAL MODE
LOCAL FN SpeakString(StringPtr&)
` subq.l #2,sp ;clear space for result
` move.l ^StringPtr&,-(sp) ;push string pointer on stack
` move.l #$0220000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'
' FUNCTION NewSpeechChannel (voice: VoiceSpecPtr; chanPtr: SpeechChannelPtr): OSErr;
'
' HOW TO CALL THE ROUTINE:
' OSErr = FN NewSpeechChannel(@VoiceSpec,@chan&)
'
LOCAL MODE
LOCAL FN NewSpeechChannel(VoiceSpecPtr&,chanPtr&)
` subq.l #2,sp ;clear space for result
` move.l ^VoiceSpecPtr&,-(sp) ;push pointers on stack
` move.l ^chanPtr&,-(sp)
` move.l #$0418000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'
' FUNCTION DisposeSpeechChannel (chan: SpeechChannel): OSErr;
'
' HOW TO CALL THE ROUTINE:
' OSErr = FN DisposeSpeechChannel(chan&)
'
LOCAL MODE
LOCAL FN DisposeSpeechChannel(channel&)
` subq.l #2,sp ;clear space for result
` move.l ^channel&,-(sp) ;channel
` move.l #$021C000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'
' FUNCTION SpeakText (chan: SpeechChannel; textbuf: Ptr; byteLen: LongInt): OSErr;
'
' HOW TO CALL THE ROUTINE:
' OSErr = FN SpeakText(chan&,@yourstring$+1,len(yourstring$))
'
LOCAL MODE
LOCAL FN SpeakText(channel&,textPtr&,textLength&)
` subq.l #2,sp ;clear space for result
` move.l ^channel&,-(sp) ;channel ptr
` move.l ^textPtr&,-(sp) ;text ptr
` move.l ^textLength&,-(sp) ;length
` move.l #$0624000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'
' FUNCTION SpeakBuffer (chan: SpeechChannel; textbuf: Ptr; byteLen: LongInt; controlFlags: LongInt): OSErr;
'
' HOW TO CALL THE ROUTINE:
' OSErr = FN SpeakBuffer(chan&,@yourstring$+1,len(yourstring$,flag&))
'
LOCAL MODE
LOCAL FN SpeakBuffer(channel&,textPtr&,textLength&,controlFlag&)
` subq.l #2,sp ;clear space for result
` move.l ^channel&,-(sp) ;channel ptr
` move.l ^textPtr&,-(sp) ;text ptr
` move.l ^textLength&,-(sp) ;length
` move.l ^controlFlag&,-(sp) ;flag
` move.l #$0828000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'
' FUNCTION ContinueSpeech (chan: SpeechChannel): OSErr;
'
' HOW TO CALL THE ROUTINE:
' OSErr = FN ContinueSpeech(chan&)
'
LOCAL MODE
LOCAL FN ContinueSpeech(channel&)
` subq.l #2,sp ;clear space for result
` move.l ^channel&,-(sp) ;channel
` move.l #$0238000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'
' FUNCTION StopSpeech (chan: SpeechChannel): OSErr;
'
' HOW TO CALL THE ROUTINE:
' OSErr = FN StopSpeech(chan&)
'
LOCAL MODE
LOCAL FN StopSpeech(channel&)
` subq.l #2,sp ;clear space for result
` move.l ^channel&,-(sp) ;channel
` move.l #$022C000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'
' FUNCTION SpeechBusy: Integer;
'
' HOW TO CALL THE ROUTINE:
' Busy = FN SpeechBusy
'
LOCAL MODE
LOCAL FN SpeechBusy
` subq.l #2,sp ;clear space for result
` move.l #$003C000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'
' FUNCTION SpeechManagerVersion: NumVersion;
'
' HOW TO CALL THE ROUTINE:
' SpeechMgrVersion = FN SpeechManagerVersion
'
LOCAL MODE
LOCAL FN SpeechManagerVersion
` subq.l #2,sp ;clear space for result
` move.l #$0000000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'========================= Article part 2 =========================
'
' FUNCTION SetSpeechRate (chan: SpeechChannel; rate: Fixed): OSErr;
'
' HOW TO CALL THE ROUTINE:
' OSErr = FN SetSpeechRate(chan&,rate&)
'
LOCAL MODE
LOCAL FN SetSpeechRate(channel&,speechrate&)
` subq.l #2,sp ;clear space for result
` move.l ^channel&,-(sp) ;channel
` move.l ^speechrate&,-(sp) ;rate
` move.l #$0444000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'
' FUNCTION GetSpeechRate (chan: SpeechChannel; rate: FixedPtr): OSErr;
'
' HOW TO CALL THE ROUTINE:
' OSErr = FN GetSpeechRate(chan&,@rate&)
'
LOCAL MODE
LOCAL FN GetSpeechRate(channel&,ratePtr&)
` subq.l #2,sp ;clear space for result
` move.l ^channel&,-(sp) ;channel
` move.l ^ratePtr&,-(sp) ;rate ptr
` move.l #$0448000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'
' FUNCTION SetSpeechPitch (chan: SpeechChannel; pitch: Fixed): OSErr;
'
' HOW TO CALL THE ROUTINE:
' OSErr = FN SetSpeechPitch(chan&,pitch&)
'
LOCAL MODE
LOCAL FN SetSpeechPitch(channel&,speechpitch&)
` subq.l #2,sp ;clear space for result
` move.l ^channel&,-(sp) ;channel
` move.l ^speechpitch&,-(sp) ;pitch
` move.l #$044C000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'
' FUNCTION GetSpeechPitch (chan: SpeechChannel; pitch: FixedPtr): OSErr;
'
' HOW TO CALL THE ROUTINE:
' OSErr = FN GetSpeechPitch(chan&,@pitch&)
'
LOCAL MODE
LOCAL FN GetSpeechPitch(channel&,pitchPtr&)
` subq.l #2,sp ;clear space for result
` move.l ^channel&,-(sp) ;channel
` move.l ^pitchPtr&,-(sp) ;pitch ptr
` move.l #$0450000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'
' FUNCTION PauseSpeechAt(chan: SpeechChannel; whereToPause: LongInt): OSErr;
'
' HOW TO CALL THE ROUTINE:
' OSErr = FN PauseSpeechAt(chan&,where&)
'
LOCAL MODE
LOCAL FN PauseSpeechAt(channel&,where&)
` subq.l #2,sp ;clear space for result
` move.l ^channel&,-(sp) ;channel
` move.l ^where&,-(sp) ;where
` move.l #$0434000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'
' FUNCTION StopSpeechAt(chan: SpeechChannel; whereToStop: LongInt): OSErr;
'
' HOW TO CALL THE ROUTINE:
' OSErr = FN StopSpeechAt(chan&,where&)
'
LOCAL MODE
LOCAL FN StopSpeechAt(channel&,where&)
` subq.l #2,sp ;clear space for result
` move.l ^channel&,-(sp) ;channel
` move.l ^where&,-(sp) ;where
` move.l #$0430000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'
' FUNCTION GetSpeechInfo(chan: SpeechChannel; selector: OSType; speechInfo: Ptr): OSErr;
'
' HOW TO CALL THE ROUTINE:
' OSErr = FN GetSpeechInfo(chan&,selector&,@structureInfo)
'
LOCAL MODE
LOCAL FN GetSpeechInfo(channel&,selector&,infoPtr&)
` subq.l #2,sp ;clear space for result
` move.l ^channel&,-(sp) ;channel
` move.l ^selector&,-(sp) ;selector
` move.l ^infoPtr&,-(sp) ;info structure Ptr
` move.l #$0658000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'
' FUNCTION SetSpeechInfo(chan: SpeechChannel; selector: OSType; speechInfo: Ptr): OSErr;
'
' HOW TO CALL THE ROUTINE:
' OSErr = FN SetSpeechInfo(chan&,selector&,@structureInfo)
'
LOCAL MODE
LOCAL FN SetSpeechInfo(channel&,selector&,infoPtr&)
` subq.l #2,sp ;clear space for result
` move.l ^channel&,-(sp) ;channel
` move.l ^selector&,-(sp) ;selector
` move.l ^infoPtr&,-(sp) ;info structure Ptr
` move.l #$0654000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
'
' FUNCTION SpeechBusySystemWide: Integer;
'
' HOW TO CALL THE ROUTINE:
' NumChannelsBusy = FN SpeechBusySystemWide
'
LOCAL MODE
LOCAL FN SpeechBusySystemWide
` subq.l #2,sp ;clear space for result
` move.l #$0040000C,D0
` dc.w $A800
` move.w (sp)+,D0
` ext.l D0
END FN
"skipfns"
REM ============================================================